import java.awt.*;
import java.awt.event.*;

public class ex7_extra3 implements ActionListener{
	Frame f;
	CheckboxGroup cbg;
	Checkbox gch,gda,gso,gse,gje;
	Label label0,label1;
	TextArea textarea;
	TextField textfield;
	String str1,str2,str3;
	Button bt0;
	int m=50,n=7;
	int i=0,j=0;
	
	public ex7_extra3(){
		f = new Frame("[라디오버튼]에서 선택한내용 [텍스트 필드,영역]에서 결과보여주기");
		
		cbg= new CheckboxGroup();
		gch = new Checkbox("천안",cbg,false);
		gda = new Checkbox("당진", cbg, false);
		gso = new Checkbox("속초", cbg, false);
		gse = new Checkbox("부산", cbg, false);
		gje = new Checkbox("제주", cbg, false);
		
		
		str1="라비오 버튼에서 선택된 내용:";
		str2="";
		
		textfield = new TextField(str1+str2,30);
		textarea = new TextArea(str1+str2,n,m);
		
		str3="텍스트영역(줄:"+m+" 열:"+n+")";
		label1 = new Label(str3);
		bt0 = new Button("종료");
		
		
	}
	public void startFrame(){
		f.setLayout(new FlowLayout());
		f.add(gch);
		f.add(gda);
		f.add(gso);
		f.add(gse);
		f.add(gje);
		f.add(textfield);
		f.add(textarea);
		
		f.add(label1);
		f.add(bt0);
		
		f.setSize(500,300);
		f.setVisible(true);
		/*
		gch.addItemListener(this);
		gda.addItemListener(this);
		gso.addItemListener(this);
		gse.addItemListener(this);
		gje.addItemListener(this);
		*/
	}
	public static void main(String[] args){
		ex7_extra3 pr = new ex7_extra3();
		pr.startFrame();
	}
	public void actionPerformed(ActionEvent e){
		String str = e.getActionCommand();
		if(str.equals("종료")) System.exit(0);

	}
	public void itemStateChanged(ItemEvent e) {
		//System.out.println(e.getItem().toString().length());
		if(e.getItem().toString().equals("0")){
		}
	}
	
}